package com.ethank.mapper;

import com.ethank.entity.oaBill.*;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @author tf
 * @date 2024-03-05
 * @Description
 */
@Mapper
public interface FnaInvoiceLedgerMapper {

    // 发票台账表sql新增
    Integer addData(Fnainvoiceledger fnainvoiceledger);


    // 发票台账表sql修改
    Integer updateFnainvoiceledger(Fnainvoiceledger fnainvoiceledger);


    // 发票台账扩展表sql删除
    Integer deleteFnaInvoiceLedgerDtl(@Param("mainid") Integer id);


    // 发票台账扩展表sql新增
    Integer addDataVo(Fnainvoiceledger fnainvoiceledgerVo);


    // 发票台账明细表sql删除
    Integer deleteFnaInvoiceLedgerDetail(@Param("mainid") Integer id);


    // 发票台账明细表sql新增
    Integer addDataDetail(@Param("details") List<FnainvoiceledgerDetail> fnainvoiceledgerDetails);


    // 航空行程单sql删除
    Integer deleteairInvoice(@Param("mainid") Integer id);


    // 航空行程单sql新增
    Integer addAirPlane(AirInvoice airInvoice);


    // 航空行程单明细sql删除
    Integer deleteairDtlInvoice(@Param("mainid") Integer id);


    // 航空行程单明细sql新增
    Integer addAirPlaneDetail(List<AirInvoiceDetail> airInvoiceDetails);


    // 火车票sql删除
    Integer deletetrainInvoice(@Param("mainid") Integer id);


    // 火车票sql新增
    Integer addTrainTicket(TrainInvoice trainInvoice);


    // 出租车sql删除
    Integer deletetaxiInvoice(@Param("mainid") Integer id);


    // 出租车sql新增
    Integer addTaxiData(TaxiInvoice taxiInvoice);


    // 客源车船票sql删除
    Integer deletecarInvoice(@Param("mainid") Integer id);


    // 客源车船票sql新增
    Integer addCarShipTicket(CarInvoice carInvoice);


    // 通用机打发票sql删除
    Integer deletemachineInvoice(@Param("mainid") Integer id);


    // 通用机打发票sql新增
    Integer addCommonInvoice(MachineInvoice machineInvoice);


    // 过路过桥费sql删除
    Integer deletetollInvoice(@Param("mainid") Integer id);


    // 过路过桥费sql新增
    Integer addTollBridge(TollInvoice tollInvoice);


    // 查询发票台账表的数据
    Fnainvoiceledger selectList();

    List<Map<String, Object>> getListRecord(@Param("filterMap") HashMap<String, Object> filterMap);

    Integer getListRecordCount(@Param("filterMap") HashMap<String, Object> filterMap);

    BigDecimal getTotalPrice(@Param("filterMap") HashMap<String, Object> filterMap);

    List<Map<String, Object>> getInvoiceHeaderList(@Param("filterMap") HashMap<String, Object> filterMap);

    Integer getInvoiceHeaderListCount(@Param("filterMap")HashMap<String, Object> filterMap);

    Integer getUserId(@Param("userId") String userId);

    /* 发票id判断是否已经触发流程 */
    Integer selectInvoiceIsExists(@Param("id") String id);

    /* 物理删除发票信息 */
    Integer deleteInvoiceInfo(@Param("id") String id);

    /* 查询发票状态是否已核销 */
    Map<String, Object> selectInvoiceWriteOff(@Param("id") String id);

    /* 根据发票号查询流程信息 */
    Map<String, Object> selectRequestIdByInvoiceNumber(@Param("invoiceNumberStr")String invoiceNumberStr);

    List<Map<String, Object>> getShopInvoiceList(@Param("shopId")String shopId);

    int saveShopInvoice(@Param("paramMap") HashMap<String, Object> paramMap);

    Integer checkShopInvoice(@Param("invoiceNumber") String invoiceNumber);
}
